<!DOCTYPE html>
<html>
    <head>
        <title>{$h_title}</title>
        <meta name="keywords" content="{$h_keywords}">
        <meta name="description" content="{$h_desc}">
        <meta charset="utf-8">
        <link rel="stylesheet" type="text/css" href="__CSS__/doctor/style.css">
        <script type="text/javascript" src="__JS__/doctor/jquery.js"></script>
    </head>
    <body class="login-header">
        <div  class="login-header">
            <p>百氏医药福通</p>
        </div>
        <div class="login-main">
            <form id="myForm">
                <div class="iogin-input"><img src="__IMG__/doctor/per.jpg"><input type="text" id="mobile" name="mobile" placeholder="请输入手机号"></div>
                <div class="iogin-input secodinput"><img src="__IMG__/doctor/pwd.png"><input type="password" id="password" name="password" placeholder="请输入密码"></div>
            </form>
            <div class="loginerror" style="display: none"><img src="__IMG__/doctor/error.png"><span id="errstr"></span></div>
            <div class="login-btn"><button id="submit">登录</button></div>
        </div>
        <script type="text/javascript">
            $(function(){
                var issend = false;
                //保存事件
                $('#submit').click(function(){
                    if(issend) return false;
                    issend = true;
                    var mydata = $('#myForm').serialize();
                    $.post(location.href,mydata,function (data){
                        issend = false;
                        if(data.code==0){
                            location.href = data.url;
                        }else{
                            //显示错误
                            $('#errstr').text(data.msg);
                            $('.loginerror').show();
                        }
                    },'json');
                });
                //获取焦点, 隐藏错误
                $('#mobile,#password').focus(function(){
                    $('#errstr').text('');
                    $('.loginerror').hide();
                });
            });
        </script>
    </body>
</html>